package com.service.Impl;

import java.util.List;
import org.apache.ibatis.session.SqlSession;
import com.dao.AddressDao;
import com.domain.Addres;
import com.domain.Address;
import com.domain.addAddres;
import com.service.AddresService;
import com.util.SqlSessionUtils;

public class AddresServiceImpl implements AddresService{
	private SqlSession sqlSession = SqlSessionUtils.getSqlSession();
	private AddressDao addressDao = sqlSession.getMapper(AddressDao.class);

    //获取地址信息详情集合
    @Override
    public List<Address> findAddress() {
        return addressDao.findAddress();
    }

    @Override
    public List<Addres> findById(int uid) {
        return addressDao.findById(uid);
    }

    @Override
    public void addAdres(addAddres add) {
        addressDao.addAdres(add);
        //提交事务
        sqlSession.commit();
    }
	
}
